/* --- GOOGLE FONTS & GLOBAL STYLES --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Roboto:wght@400;500;700&display=swap');

:root {
    /* White & Yelp Red Color Palette */
    --primary-color: #D32323;   /* Yelp Red */
    --primary-hover: #AF1A1A;   /* Darker Red for hover */
    --background-light: #FFFFFF; /* White background */
    --surface-light: #F9F9F9;   /* Very light grey for cards */
    --text-dark: #2c2c2c;       /* Off-black for primary text for comfort */
    --text-muted: #6e6e6e;     /* Medium grey for secondary text */
    --border-color: #e0e0e0;   /* Light grey for borders */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-light);
    color: var(--text-dark);
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- SPLASH SCREEN --- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    padding: 20px;
}

.splash-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 10vw, 5rem); /* Adjusted clamp for better mobile fit */
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    animation: fadeInDown 1s ease-out forwards;
}

.splash-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(0.9rem, 4vw, 1.3rem); /* Adjusted clamp for better mobile fit */
    color: var(--text-dark);
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

/* --- MAIN WRAPPER & TRANSITIONS --- */
#main-wrapper {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-in-out, transform 0.7s ease-in-out;
}

#main-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- HEADER & NAVIGATION --- */
.main-header {
    text-align: center;
    padding: 30px 20px 15px; /* Adjusted padding */
}

.main-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.2rem, 8vw, 3.2rem); /* Adjusted clamp */
    color: var(--text-dark);
}

.main-nav {
    background-color: rgba(255, 255, 255, 0.90); /* Slightly less transparent for better readability */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 0; /* Reduced padding for a more compact nav */
    margin-bottom: 30px; /* Reduced margin */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.main-nav ul {
    list-style-type: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping for extremely narrow screens if needed, though horizontal scroll is primary */
    gap: 8px; /* Reduced gap */
    margin: 0;
    padding: 0 10px; /* Padding inside the UL for scroll content */
}

.main-nav ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px; /* Slightly reduced font size */
    font-weight: 500;
    padding: 8px 12px; /* Reduced padding */
    border-radius: 6px; /* Slightly smaller radius */
    transition: all 0.3s ease;
    white-space: nowrap;
}

.main-nav ul li a:hover, .main-nav ul li a.active {
    color: #ffffff;
    background-color: var(--primary-color);
}

/* --- MAIN CONTENT & SECTIONS --- */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

main > section {
    background-color: var(--surface-light);
    padding: 25px; /* Slightly reduced padding */
    margin-bottom: 30px; /* Slightly reduced margin */
    border-radius: 12px; /* Slightly smaller radius */
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04); /* Softer shadow */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

main > section:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

.section-title-container {
    text-align: center;
    margin-bottom: 20px; /* Reduced margin */
}

section h2 {
    font-size: 1.8rem; /* Adjusted font size */
    color: var(--text-dark);
    font-weight: 700;
    padding-bottom: 12px; /* Adjusted padding */
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

section h3 {
    font-size: 1.4rem; /* Adjusted font size */
    color: var(--text-dark);
    text-align: center;
    margin: 25px 0 15px; /* Adjusted margin */
    font-weight: 600;
}

/* --- TABLES & INPUTS --- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Rounded corners for the container */
    margin-bottom: 25px;
}

table {
    width: 100%;
    border-collapse: collapse; /* Better to keep this for internal table structure */
}

table th, table td {
    padding: 12px 15px; /* Adjusted padding */
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 15px; /* Ensure table text is readable */
}

table th {
    background-color: var(--surface-light);
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-width: 2px; /* Slightly thicker border for header */
}

table tr:last-child td {
    border-bottom: none;
}

.grade-input, .requirement-subject {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    color: var(--text-dark);
    background-color: var(--background-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.grade-input:focus, .requirement-subject:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(211, 35, 35, 0.15);
}

/* --- BUTTONS & RESULTS --- */
button {
    display: block;
    width: 90%;
    max-width: 280px; /* Max width for larger mobile screens */
    padding: 14px 25px; /* Adjusted padding */
    margin: 30px auto 20px auto; /* Adjusted margin */
    border: none;
    border-radius: 50px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 17px; /* Adjusted font size */
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(211, 35, 35, 0.2);
    transition: all 0.3s ease;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(211, 35, 35, 0.3);
}

.gpa-results-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
}

.result-text {
    color: var(--text-dark);
    font-size: 1.4rem; /* Slightly smaller results font */
    text-align: center;
    font-weight: bold;
    animation: popIn 0.5s ease;
    margin: 5px 0;
}

/* --- TOGGLE & COLLAPSIBLE SECTIONS --- */
.requirements-section,
#normalized-gpa-info-section {
    text-align: center;
}

.toggle-button {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.3s ease;
    margin-top: 15px; /* Reduced margin */
    padding: 8px;
    display: inline-block;
    border-radius: 4px;
    font-size: 1.1rem; /* Adjusted size for toggle */
}

.toggle-button:hover {
    color: var(--primary-hover);
}

.hidden {
    display: none;
}

.requirement-list {
    margin: 15px 0;
    padding: 15px; /* Reduced padding */
    background-color: var(--background-light);
    border-left: 3px solid var(--primary-color); /* Thinner border */
    border-radius: 0 6px 6px 0;
    text-align: left;
}

/* --- FOOTER --- */
footer {
    background-color: var(--surface-light);
    color: var(--text-muted);
    text-align: center;
    padding: 30px 20px; /* Reduced padding */
    border-top: 1px solid var(--border-color);
    margin-top: 40px; /* Reduced margin */
}

.footer-socials {
    margin-bottom: 15px;
}

.footer-socials a {
    color: var(--text-muted);
    font-size: 1.8rem; /* Slightly smaller icons */
    margin: 0 12px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-socials a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.footer-credit {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem; /* Smaller credit text */
    color: var(--text-dark);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* --- ANIMATIONS --- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); } /* Softer animation */
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); } /* Softer animation */
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); } /* Softer animation */
    to { opacity: 1; transform: scale(1); }
}

/*
==============================================
    MOBILE RESPONSIVE STYLES
==============================================
*/
@media (max-width: 768px) {
    .main-header h1 {
        font-size: clamp(1.8rem, 7vw, 2.2rem); /* Further refinement for mobile header */
    }
    
    .main-nav {
        padding: 5px 0; /* More compact nav */
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    .main-nav ul {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
        padding: 5px 10px; /* Padding for scrollable area */
    }

    .main-nav ul::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
    }
    
    .main-nav ul li a {
        white-space: nowrap;
        padding: 8px 10px; /* Smaller padding for nav links */
        font-size: 14px; /* Smaller font for nav links */
    }

    main > section {
        padding: 20px 15px; /* Consistent padding for sections */
    }

    main > section:hover {
        transform: none;
    }

    section h2 {
        font-size: 1.5rem; /* Readable h2 on mobile */
    }
    
    section h3 {
        font-size: 1.2rem; /* Readable h3 on mobile */
        margin: 20px 0 10px;
    }

    .result-text {
        font-size: 1.3rem; /* Readable result text */
    }

    .toggle-button {
        font-size: 1rem;
    }

    .footer-credit {
        font-size: 0.9rem;
    }

    /* Table cell padding and font size */
    table th, table td {
        padding: 10px 12px;
        font-size: 13px; /* Slightly smaller table text */
    }

    /* Button adjustments for mobile */
    button {
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) { /* Styles for very small screens */
    .main-header h1 {
        font-size: 1.6rem;
    }
    .splash-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
    .splash-subtitle {
        font-size: clamp(0.8rem, 4vw, 1rem);
    }
    section h2 {
        font-size: 1.3rem;
    }
    section h3 {
        font-size: 1.1rem;
    }
    .result-text {
        font-size: 1.2rem;
    }
    .main-nav ul li a {
        font-size: 13px;
        padding: 6px 8px;
    }
     button {
        padding: 10px 18px;
        font-size: 15px;
    }
    table th, table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    .footer-socials a {
        font-size: 1.6rem;
        margin: 0 10px;
    }
    .footer-credit {
        font-size: 0.8rem;
    }
}